const http = require('./http');
// 记录下是否有ck/usercode、；T/F
module.exports = {
  wxLogin(p) { //小程序登录   F
    var data=http('/login', p)
    //console.log("xxxxx=",data)
    return data
  },
  wxLogOut(p) { //退出登录；
    return http('/outlogin', p, {
      title: '登出中'
    })
  },
  // distribute(params) {//发布订单
  //   return http('/order/insertOrder',params)
  // },
  editOrder(params) {
    return http('/xxx', params)
  },
  // 获取首页的所有订单；
  getAllOrder(params, config) {
    return http('/order/list', params, 'GET', config)
  },
  sendOrder(params) {//发布订单
    return http('/order', params)
  },
  addAddress(params) {
    return http('/address', params)
  },
  editAddress(params) {
    return http('/address', params, 'PUT')
    // return http('/address/editRecyclerAddress', params, 'PUT')
  },
  getAddress(params) {
    //return http('/address/getlistByUserId', params, 'GET')
    // var data=http('/address/getlistByUserId', params, 'GET')
    // console.log("api-js-getAddress=",data)
    return http('/address/getlistByUserId', params, 'GET')
  },
  getCollection(params) {
    var data=http('/collection/list', params, 'GET')
    //console.log("soucang=",data)
    return data
  },
  getCollectionForUserId(params) {
    var data=http('/collection/listUid', params, 'GET')
    console.log("soucang=",data)
    return data
  },
  delCollection(params) {
    return http('/collection/' + params.id, {}, 'DELETE')
  },
  cancelCollection(params) {
    return http('/collection/cancelcollection', params)
  },
  addCollection(params) {
    return http('/collection', params)
  },
  getOrder(params) {
    var data=http('/order/list', params, 'GET')
    //console.log("getOrder=",data)
    return data
  },
  getDetail(params) {
    return http('/order/' + params.id, {}, 'GET')
  },
  getDisOrder(params) {
    return http('/order/list', params, 'GET')
  },
  // changeOrderStatus(params) {
  //   return http('/order', params, 'PUT')
  // },
  changeOrderStatus(params) {
    return http('/order/update', params,)
  },
  addComplaint(params) {
    return http('/complaint', params, 'POST')
  }
}